﻿using System;
using System.Windows.Forms;

namespace Editor
{
    partial class EditorWindow
    {
        private void MainViewResetLayout_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.Reset();
            this.Size = Properties.Settings.Default.EditorWindowSize;
            this.Location = Properties.Settings.Default.EditorWindowLocation;
            this.WindowState = Properties.Settings.Default.EditorWindowState;
            Properties.Settings.Default.Save();

            ToolStripManager.LoadSettings(this, "EditorToolBarsReset");
            ToolStripManager.SaveSettings(this, "EditorToolBars");
        }

        private void MainMenuHelpAbout_Click(object sender, EventArgs e)
        {
            using (Form frm = new AboutWindow())
            {
                frm.ShowDialog(this);
            }
        }

        private void MainMenuFileExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void MainMenuFileNewScene_Click(object sender, EventArgs e)
        {
            OnActionNewScene();
        }

        private void MainMenuFileOpenScene_Click(object sender, EventArgs e)
        {
            OnActionOpenScene();
        }

        private void MainMenuFileSaveScene_Click(object sender, EventArgs e)
        {
            OnActionSaveScene();
        }

        private void MainMenuFileSaveSceneAs_Click(object sender, EventArgs e)
        {
            OnActionSaveSceneAs();
        }

        private void mnu_MainMenuEditUndo_Click(object sender, EventArgs e)
        {
            OnActionUndo();
        }

        private void mnu_MainMenuEditRedo_Click(object sender, EventArgs e)
        {
            OnActionRedo();
        }

        private void mnu_MainMenuEditPreferences_Click(object sender, EventArgs e)
        {
            using (Form frm = new PreferencesWindow())
            {
                frm.ShowDialog(this);
            }
        }
    }
}
